Enhanced FindComponentByInfPath for robust, case-insensitive and normalized based INF path matching to improve module lookup accuracy#787
Conversation
…alized based INF path matching to improve module lookup accuracy
Javagedes
left a comment
There was a problem hiding this comment.
Overall this PR seems fine. I think there needs to be a bit more comments toward the latter half of the changes as you start doing random indexing and it gets a bit confusing.
You also need to write new test cases to cover this extra functionality. Not only does it ensure it works as expected but it can help prevent regressions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #787 +/- ##
=======================================
Coverage 82.10% 82.10%
=======================================
Files 47 47
Lines 7881 7881
=======================================
Hits 6471 6471
Misses 1410 1410 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Use pathlib for consistent path normalization and consolidate exact/suffix matching, returning only the closest unambiguous match.
|
@sndeb thank you for the extra inline documentation, this PR looks great. As mentioned before, please add tests to cover this new functionality. Tests for this should probably go here: https://github.com/tianocore/edk2-pytool-library/tree/master/tests.unit/parsers It does not look like we have unit tests for the build report parser, so please add some to cover your logic. I'll create an issue for myself to add even more on top of that. My main focus on unit tests is so we can prevent functionality regression with future changes. Thanks! |
Improve FindComponentByInfPath matching logic